package com.bluesky.controller;

import com.bluesky.comm.Result;
import com.bluesky.comm.ResultUtils;
import com.bluesky.dto.lesson025.UserPageQuery;
import com.bluesky.page.PageResult;
import com.bluesky.po.lesson025.Lesson025UserPO;
import com.bluesky.service.lesson025.Lesson025UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/lesson025")
public class Lsson025Controller {

    @Autowired
    private Lesson025UserService lesson025UserService;

    @GetMapping("/selectPage")
    public Result<PageResult<Lesson025UserPO>> selectPage(@RequestParam("pageNum") int pageNum, @RequestParam("/pageSize") int pageSize){
        PageResult<Lesson025UserPO> pageResult = lesson025UserService.selectPage(pageNum, pageSize);
        return ResultUtils.success(pageResult);
    }

    @GetMapping("/selectPageNew")
    public Result<PageResult<Lesson025UserPO>> selectPageNew(@RequestParam("pageNum") int pageNum, @RequestParam("/pageSize") int pageSize){
        PageResult<Lesson025UserPO> pageResult = lesson025UserService.selectPageNew(pageNum, pageSize);
        return ResultUtils.success(pageResult);
    }

    @GetMapping("/userPage")
    public Result<PageResult<Lesson025UserPO>> userPage(UserPageQuery query){
        PageResult<Lesson025UserPO> page = lesson025UserService.userPage(query);
        return ResultUtils.success(page);
    }
}
